<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<aside th:fragment="sidebar-fragment(path)" class="main-sidebar sidebar-dark-primary elevation-4">
    <!-- Brand Logo -->
    <a href="index.html" class="brand-link">
        <img src="../../../admin/dist/img/AdminLTELogo.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3"
             style="opacity: .8">
        <span class="brand-text font-weight-light">AdminLTE 3</span>
    </a>

    <!-- Sidebar -->
    <div class="sidebar">
        <!-- Sidebar user panel (optional) -->
        <div class="user-panel mt-3 pb-3 mb-3 d-flex">
            <div class="image">
                <img src="../../../admin/dist/img/user2-160x160.jpg" class="img-circle elevation-2" alt="User Image">
            </div>
            <div class="info">
                <a href="#" class="d-block" >
                    <th:block th:text="${session.loginUser}"></th:block>
                </a>
            </div>
        </div>
        <!-- Sidebar Menu -->
        <nav class="mt-2">
            <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
                <!-- Add icons to the links using the .nav-icon class
                     with font-awesome or any other icon font library -->
                <li class="nav-item has-treeview">
                    <a th:href="@{/admin/index}" th:class="${path}=='index'?'nav-link active':'nav-link'">
                        <i class="nav-icon fas fa-tachometer-alt"></i>
                        <p>
                            Dashboard
                        </p>
                    </a>
                </li>
                <div style="height: 30px;"></div>
                <li class="nav-item">
                    <a th:href="@{/admin/goods/edit}" th:class="${path}=='edit'?'nav-link active':'nav-link'">
                        <i class="nav-icon fa fa-plus"></i>
                        <p>商品信息</p>
                    </a>
                </li>

                <div style="height: 30px;"></div>
                <!-- 首页配置被选中 -->
                    <li th:if="${path eq 'carouse' || path eq 'hot' || path eq 'news' || path eq 'recommend'}" class="nav-item has-treeview menu-open">
                        <a href="#" class="nav-link active">
                            <i class="nav-icon fas fa-tree"></i>
                            <p>
                                首页配置
                                <i class="fas fa-angle-left right"></i>
                            </p>
                        </a>
                        <ul class="nav nav-treeview">
                            <li class="nav-item">
                                <a th:href="@{/admin/goods/carouse}" th:class="${path}=='carouse'?'nav-link active':'nav-link'">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>轮播图配置</p>
                                </a>
                            </li>
                            <li class="nav-item">
                                <a th:href="@{/admin/goods/hot}" th:class="${path}=='hot'?'nav-link active':'nav-link'">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>热销商品配置</p>
                                </a>
                            </li>
                            <li class="nav-item">
                                <a th:href="@{/admin/goods/news}" th:class="${path}=='news'?'nav-link active':'nav-link'">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>新品上线配置</p>
                                </a>
                            </li>
                            <li class="nav-item">
                                <a th:href="@{/admin/goods/recommend}" th:class="${path}=='recommend'?'nav-link active':'nav-link'">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>为您推荐配置</p>
                                </a>
                            </li>
                        </ul>
                    </li>
                    <!-- 首页配置没有被选中 -->
                    <li th:unless="${path eq 'carouse' || path eq 'hot' || path eq 'news' || path eq 'recommend'}"  class="nav-item has-treeview menu-open">
                        <a href="#" class="nav-link">
                            <i class="nav-icon fas fa-tree"></i>
                            <p>
                                首页配置
                                <i class="fas fa-angle-left right"></i>
                            </p>
                        </a>
                        <ul class="nav nav-treeview">
                            <li class="nav-item">
                                <a th:href="@{/admin/goods/carouse}" th:class="${path}=='carouse'?'nav-link active':'nav-link'">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>轮播图配置</p>
                                </a>
                            </li>
                            <li class="nav-item">
                                <a th:href="@{/admin/goods/hot}" th:class="${path}=='hot'?'nav-link active':'nav-link'">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>热销商品配置</p>
                                </a>
                            </li>
                            <li class="nav-item">
                                <a th:href="@{/admin/goods/news}" th:class="${path}=='news'?'nav-link active':'nav-link'">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>新品上线配置</p>
                                </a>
                            </li>
                            <li class="nav-item">
                                <a th:href="@{/admin/goods/recommend}" th:class="${path}=='recommend'?'nav-link active':'nav-link'">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>为您推荐配置</p>
                                </a>
                            </li>
                        </ul>
                    </li>
                <div style="height: 30px;"></div>
                <!-- 管理模块被选中 -->
                <li th:if="${path eq 'categorymanage' || path eq 'goodsmanage' || path eq 'vipmange' || path eq 'ordermanage'}" class="nav-item has-treeview menu-open">
                    <a href="#" class="nav-link active">
                        <i class="nav-icon fas fa-edit"></i>
                        <p>
                            管理模块
                            <i class="fas fa-angle-left right"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <li class="nav-item">
                            <a th:href="@{/admin/goods/categorymanage}" th:class="${path}=='categorymanage'?'nav-link active':'nav-link'">
                                <i class="far fa-circle nav-icon"></i>
                                <p>分类管理</p>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a th:href="@{/admin/goods/goodsmanage}" th:class="${path}=='goodsmanage'?'nav-link active':'nav-link'">
                                <i class="far fa-circle nav-icon"></i>
                                <p>商品管理</p>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a th:href="@{/admin/goods/vipmange}" th:class="${path}=='vipmange'?'nav-link active':'nav-link'">
                                <i class="far fa-circle nav-icon"></i>
                                <p>会员管理</p>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a th:href="@{/admin/goods/ordermanage}" th:class="${path}=='ordermanage'?'nav-link active':'nav-link'">
                                <i class="far fa-circle nav-icon"></i>
                                <p>订单管理</p>
                            </a>
                        </li>
                    </ul>
                </li>
                <!--管理模块没有被选中-->
                <li th:unless="${path eq 'categorymanage' || path eq 'goodsmanage' || path eq 'vipmange' || path eq 'ordermanage'}" class="nav-item has-treeview menu-open">
                    <a href="#" class="nav-link">
                        <i class="nav-icon fas fa-edit"></i>
                        <p>
                            管理模块
                            <i class="fas fa-angle-left right"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <li class="nav-item">
                            <a th:href="@{/admin/goods/categorymanage}" th:class="${path}=='category'?'nav-link active':'nav-link'">
                                <i class="far fa-circle nav-icon"></i>
                                <p>分类管理</p>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a th:href="@{/admin/goods/goodsmanage}" th:class="${path}=='goodsmanage'?'nav-link active':'nav-link'">
                                <i class="far fa-circle nav-icon"></i>
                                <p>商品管理</p>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a th:href="@{/admin/goods/vipmange}" th:class="${path}=='vipmange'?'nav-link active':'nav-link'">
                                <i class="far fa-circle nav-icon"></i>
                                <p>会员管理</p>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a th:href="@{/admin/goods/ordermanage}" th:class="${path}=='ordermanage'?'nav-link active':'nav-link'">
                                <i class="far fa-circle nav-icon"></i>
                                <p>订单管理</p>
                            </a>
                        </li>
                    </ul>
                </li>
                <div style="height: 30px;"></div>
                <li class="nav-header">系统管理</li>
                <li class="nav-item">
                    <a th:href="@{/admin/goods/updatepwd}" th:class="${path}=='updatepwd'?'nav-link active':'nav-link'">
                        <i class="nav-icon far fa-calendar-alt"></i>
                        <p>
                            修改密码
                        </p>
                    </a>
                </li>
                <li class="nav-item">
                    <a th:href="@{/admin/logout}" class="nav-link">
                        <i class="fa fa-sign-out nav-icon"></i>
                        <p>
                            安全退出
                        </p>
                    </a>
                </li>
                <div style="height: 30px">

                </div>
                <li class="nav-item">
                    <a th:href="@{/admin/goods/updatepwd}" th:class="${path}=='updatepwd'?'nav-link active':'nav-link'">
                        <i class="nav-icon far fa-calendar-alt"></i>
                        <p>
                            修改密码
                        </p>
                    </a>
                </li>
                <li class="nav-item">
                    <a th:href="@{/admin/logout}" class="nav-link">
                        <i class="fa fa-sign-out nav-icon"></i>
                        <p>
                            安全退出
                        </p>
                    </a>
                </li>
            </ul>
        </nav>
        <!-- /.sidebar-menu -->
    </div>
    <!-- /.sidebar -->
</aside>
</html>